package org.jeecg.modules.index;

import com.alibaba.fastjson.JSONObject;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.index.service.IndexPageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.*;
import org.jeecg.common.api.vo.Result;

/**
 * @description: 欢迎页API
 * @author: zwf
 * @create: 2025-06-12 15:28
 **/
@Slf4j
@Tag(name = "APP INDEX API")
@RestController
@RequestMapping("/app/index")
public class IndexPageApi {

    @Resource
    private IndexPageService service;

    @GetMapping("/ok")
    public String ok() {
        return "OK";
    }

    @PostMapping("/reverse")
    @Operation(summary = "地址逆解析")
    public Result<String> reverse(@RequestBody JSONObject latLng) {
        log.info("经纬度：{}", latLng);
        return Result.OK(service.reverse(latLng));
    }

    @PostMapping("/remind")
    @Operation(summary = "提醒挪车")
    public Result<String> remind(@RequestBody JSONObject params) {
        log.info("参数：{}", params);
        return service.remind(params);
    }

    @PostMapping("/getPlateNumber")
    @Operation(summary = "获取车牌号")
    public Result<String> getPlateNumber(@RequestBody JSONObject params) {
        log.info("参数：{}", params);
        return service.getPlateNumber(params);
    }

}
